package cn.xy
import com.norbitltd.spoiwo.model._
import com.norbitltd.spoiwo.model.enums.CellFill
import com.norbitltd.spoiwo.natures.xlsx.Model2XlsxConversions._
import org.joda.time.LocalDate

/**
  * Created by xiaoyuan on 2017/11/10.
  */
object Execl {
  def main(args: Array[String]): Unit = {
    val headerStyle =
      CellStyle(fillPattern = CellFill.Solid,
        fillForegroundColor = Color.AquaMarine,
        font = Font(bold = true))

    var rows = List[Row]();
    rows=rows :+ Row().withCellValues("1","2","3","4");

    val gettingStartedSheet = Sheet(name="1").withRows(Row(style = headerStyle)
      .withCellValues("NAME", "BIRTH DATE", "DIED AGED", "FEMALE"))
      .addRows(rows);
      /*
      Sheet(name = "Some serious stuff")
      .withRows(
        Row(style = headerStyle).withCellValues("NAME", "BIRTH DATE", "DIED AGED", "FEMALE"),
        Row().withCellValues("Marie Curie", new LocalDate(1867, 11, 7), 66, true),
        Row().withCellValues("Albert Einstein", new LocalDate(1879, 3, 14), 76, false),
        Row().withCellValues("Erwin Shrodinger", new LocalDate(1887, 8, 12), 73, false)
      )
      .withColumns(
        Column(index = 0, style = CellStyle(font = Font(bold = true)), autoSized = true)
      )*/

    gettingStartedSheet.saveAsXlsx("D:\\getting_started.xlsx")
  }
}
